package com.hycat.mail.product;

import org.apache.commons.lang3.StringUtils;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

/**
 * @author : lzhycat
 * @date : 2022-08-02 14:20
 */
public class FileUtils {

    public static void main(String[] args) {
        System.out.println(getNextMonth("2022-12-23"));
    }

    private static String getNextMonth(String today) {
        String year = today.substring(0, 4);
        String month = today.substring(5, 7);
        if(StringUtils.equals(month, "12")) { //month=12 year+1 month=1
            return (Integer.parseInt(year) + 1) + "-01-01 00:00:00";
        } else { //month!=12 year不变 month+1
            return year + "-" + (Integer.parseInt(month) + 1) + "-01 00:00:00";
        }
    }
}
